
export default {
    render(h){
      //新增属性 isRouterView  用于标记自己是isRouterView，注意是父组件 先设置isRouterView=true，再到子组件
      //用于子组件遍历向上遍历是是判断父级是否为isRouterView
        this.$vnode.data.isRouterView = true
       let depth = 0 //默认从根往上找，如 /About/Info/Detail,那么就是从 Detail -> Info -> About,结果depth = 2
        let parent = this.$parent 
        while (parent) {
          const vnodeData = parent.$vnode && parent.$vnode.data
          if(vnodeData) {
            if(vnodeData.isRouterView) {
              depth++
            }
          }
            parent = parent.$parent 
        }
        let component = null 
        console.log("matchList",this.$router.matchList , "depth" ,depth)
        const route = this.$router.matchList[depth]
        console.log("route",route)
        if (route) {
          component = route.component
        }
        return h(component)
    }
  }
   